import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-10-03
 * Time:10:24
 */
class Solution {
    public int removeDuplicates(int[] nums) {
        int count= nums.length;
        for(int i=0 ; i< count-1; i++){
           while(nums[i]==nums[i+1]){
               for(int j=i+1;j< count-1;j++){
                   nums[j]=nums[j+1];

               }
               count--;
           }
        }
       return count;
    }
}
public class TestDemo {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[] nums =new int[]{-1,0,0,0,0,3,3};
        Solution solution=new Solution();
        int count=solution.removeDuplicates(nums);
        for (int i = 0; i < count; i++) {
            System.out.print(nums[i]+" ");
        }


    }
}

